package com.sunkai.control.bs;

import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;

import com.paramInjector.MethodAnnotation;
import com.paramInjector.ParamClass;
import com.paramInjector.ParamInjector;
import com.paramInjector.ParameterAnnotation;
import com.sunkai.control.SunKaiControl;

public class X {

	public static void main(String[] args) throws Exception, SecurityException {
		ParamClass paramClass = new ParamClass(new ParamInjector() {
			
			@Override
			public Object getObject(AccessibleObject executable, Class paramClass,
					MethodAnnotation methodAnnotation,
					ParameterAnnotation parameterAnnotation, ParamClass paramClassinj) {
				if(paramClass ==String.class){
					return "sunKai";
				}
				return null;
			}
		});
		
		paramClass.put(int.class,10);
		Method executable = X.class.getDeclaredMethod("xxx", String.class,int.class);
		
		Object params[] = paramClass.getParams(executable);
		
		executable.invoke(new X(), params);
	}
	public void xxx(String x,int a){
		System.out.println(x+" "+a);
	}

}
